package com.china.lottery.listener.dao;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.Query;

import com.china.lottery.listener.dao.base.CommonDao;
import com.china.lottery.listener.dao.entity.LChannelBetSwitch;
import com.china.lottery.listener.util.Tools;

@Repository
public class LChannelBetSwitchDao  extends CommonDao{
	
	@SuppressWarnings("unchecked")
	public List<LChannelBetSwitch> queryLChannelBetSwitch(String betchannelCodes){
		String sql = "select t from LChannelBetSwitch t where t.isSpareChannel = :isSpareChannel and  t.betchannelCodes = :betchannelCodes ";
		Query q = em.createQuery(sql);
		q.setParameter("isSpareChannel", 1);
		q.setParameter("betchannelCodes", betchannelCodes);
		List<LChannelBetSwitch> list = q.getResultList();
		if (Tools.isBlank(list)) {
			return null;
		}
		return list;
	}
}
